/* styles.css - 海洋主题网络投票系统 - 优化版 */
/* 基础样式重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #e6f7ff 0%, #c7ecee 100%);
    color: #0a3d62;
    padding: 20px;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 10% 20%, rgba(34, 166, 179, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(6, 82, 221, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 50% 30%, rgba(10, 61, 98, 0.1) 0%, transparent 30%);
    background-size: 100% 100%;
    opacity: 0.6;
    z-index: -1;
}

/* 波浪背景 */
.wave-bg {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none"><path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25" fill="%2322a6b3"/><path d="M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z" opacity=".5" fill="%230652DD"/><path d="M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z" fill="%230a3d62"/></svg>');
    background-size: 1200px 100px;
    background-repeat: repeat-x;
    z-index: -1;
    animation: wave 15s linear infinite;
}

@keyframes wave {
    0% { background-position-x: 0; }
    100% { background-position-x: 1200px; }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(10, 61, 98, 0.15);
    padding: 30px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(23, 107, 135, 0.1);
    backdrop-filter: blur(5px);
    z-index: 1;
}

.container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #22a6b3, #0652DD, #22a6b3);
    background-size: 200% 200%;
    animation: gradientBar 5s ease infinite;
}

@keyframes gradientBar {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

h1 {
    color: #0a3d62;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #22a6b3;
    font-size: 32px;
    font-weight: 700;
    position: relative;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

h1::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 80px;
    height: 3px;
    background: #0652DD;
    border-radius: 3px;
}

/* 错误消息样式 */
.error-message {
    color: #e74c3c;
    background-color: #ffebee;
    border: 1px solid #ffcdd2;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.1);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 投票表单样式 */
.vote-form {
    margin-top: 25px;
}

fieldset {
    border: 2px solid #a4d3ee;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 5px 15px rgba(10, 61, 98, 0.1);
    position: relative;
}

fieldset::before {
    content: "🌊";
    position: absolute;
    top: -15px;
    right: 20px;
    font-size: 24px;
    color: #22a6b3;
}

legend {
    font-weight: 700;
    color: #0a3d62;
    padding: 0 15px;
    font-size: 20px;
    background: #e6f7ff;
    border-radius: 20px;
    border: 1px solid #a4d3ee;
    box-shadow: 0 3px 8px rgba(10, 61, 98, 0.1);
}

.choice-item {
    margin: 18px 0;
    padding: 15px 20px;
    background: #e6f7ff;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    cursor: pointer;
    border: 1px solid transparent;
    box-shadow: 0 3px 8px rgba(10, 61, 98, 0.05);
    position: relative;
    overflow: hidden;
}

.choice-item:hover {
    background: #d1f0f0;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(34, 166, 179, 0.2);
    border-color: #22a6b3;
}

.choice-item::before {
    content: "🐠";
    position: absolute;
    left: -10px;
    font-size: 18px;
    opacity: 0;
    transition: all 0.3s ease;
}

.choice-item:hover::before {
    opacity: 1;
    transform: translateX(15px);
}

.choice-item input[type="radio"] {
    margin-right: 15px;
    transform: scale(1.3);
    cursor: pointer;
    accent-color: #22a6b3;
}

/* 按钮通用样式 */
.vote-btn, .admin-link, .action-btn, .btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.4s;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    border: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(10, 61, 98, 0.2);
    z-index: 1;
    transform: translateY(0);
}

.vote-btn::before, .admin-link::before, .action-btn::before, .btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: all 0.5s;
    z-index: -1;
}

.vote-btn:hover::before, .admin-link:hover::before, .action-btn:hover::before, .btn:hover::before {
    transform: translateX(100%);
}

.vote-btn {
    background: linear-gradient(135deg, #0652DD 0%, #22a6b3 100%);
    color: white;
}

.vote-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(6, 82, 221, 0.3);
}

/* 首页样式 */
.poll-list {
    list-style: none;
    margin-bottom: 35px;
}

.poll-item {
    padding: 18px;
    margin-bottom: 15px;
    background: #e6f7ff;
    border-radius: 10px;
    transition: all 0.4s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #a4d3ee;
    box-shadow: 0 4px 12px rgba(10, 61, 98, 0.08);
    position: relative;
    overflow: hidden;
}

.poll-item:hover {
    background: #d1f0f0;
    transform: translateX(8px);
    box-shadow: 0 8px 20px rgba(34, 166, 179, 0.25);
    border-color: #22a6b3;
}

.poll-item::after {
    content: "→";
    position: absolute;
    right: 20px;
    color: #0a3d62;
    font-weight: bold;
    opacity: 0;
    transition: all 0.3s ease;
}

.poll-item:hover::after {
    opacity: 1;
    transform: translateX(10px);
}

.poll-link {
    color: #0a3d62;
    text-decoration: none;
    font-weight: 600;
    flex-grow: 1;
    font-size: 18px;
    transition: all 0.3s;
}

.poll-link:hover {
    color: #0652DD;
    text-decoration: none;
}

.vote-tag {
    background: linear-gradient(135deg, #0652DD 0%, #22a6b3 100%);
    color: white;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 15px;
    margin-left: 15px;
    font-weight: 500;
    box-shadow: 0 3px 8px rgba(6, 82, 221, 0.2);
}

.no-polls {
    color: #7f8c8d;
    font-style: italic;
    padding: 20px;
    text-align: center;
    font-size: 18px;
    background: #e6f7ff;
    border-radius: 10px;
    border: 1px dashed #22a6b3;
}

.admin-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
    margin-top: 0;
    background: linear-gradient(135deg, #0a3d62 0%, #1a5f87 100%);
    color: white;
}

.admin-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(10, 61, 98, 0.3);
}

/* 结果页样式 */
.results-list {
    list-style: none;
    margin-bottom: 40px;
}

.result-item {
    padding: 18px 25px;
    margin-bottom: 15px;
    background: #e6f7ff;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.4s ease;
    border: 1px solid #a4d3ee;
    box-shadow: 0 4px 12px rgba(10, 61, 98, 0.08);
    position: relative;
    overflow: hidden;
}

.result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(34, 166, 179, 0.25);
    border-color: #22a6b3;
}

.result-item span {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    color: #0a3d62;
}

.vote-count {
    background: linear-gradient(135deg, #0652DD 0%, #22a6b3 100%);
    color: white;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 16px;
    min-width: 100px;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(6, 82, 221, 0.2);
}

.result-item::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(135deg, #e74c3c, #0652DD);
    border-radius: 10px 0 0 10px;
    width: calc((var(--votes) / var(--total-votes)) * 100%);
    z-index: 0;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.action-buttons {
    display: flex;
    gap: 20px;
    margin-top: 35px;
    flex-wrap: wrap;
}

.revote-btn {
    background: linear-gradient(135deg, #0652DD 0%, #22a6b3 100%);
    color: white;
    padding: 14px 32px;
}

.revote-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(6, 82, 221, 0.3);
}

.home-btn {
    background: linear-gradient(135deg, #e6f7ff 0%, #d1f0f0 100%);
    color: #0a3d62;
    border: 1px solid #a4d3ee;
    padding: 14px 32px;
}

.home-btn:hover {
    background: linear-gradient(135deg, #d1f0f0 0%, #b2ebf2 100%);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(34, 166, 179, 0.2);
}

/* 总投票数统计样式 */
.total-votes-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.total-votes-label {
    font-weight: 600;
    margin-right: 10px;
}

.total-votes-count {
    background: linear-gradient(135deg, #0652DD 0%, #22a6b3 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(6, 82, 221, 0.2);
}

/* ====================== 主页样式 ====================== */
.home-container {
    max-width: 900px;
    margin: 60px auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    box-shadow: 0 20px 50px rgba(10, 61, 98, 0.25);
    padding: 60px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(23, 107, 135, 0.2);
    backdrop-filter: blur(5px);
}

.home-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(90deg, #0652DD, #22a6b3, #0a3d62);
    animation: gradientBar 5s ease infinite;
}

.home-container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(90deg, #0a3d62, #22a6b3, #0652DD);
    animation: gradientBar 5s ease infinite reverse;
}

.home-container h1 {
    color: #0a3d62;
    font-size: 42px;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 3px solid #22a6b3;
    text-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
}

.home-container h1::after {
    width: 120px;
    height: 4px;
    background: linear-gradient(to right, #0a3d62, #0652DD);
    bottom: -3px;
}

.home-description {
    color: #1a5f87;
    font-size: 20px;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto 50px;
    text-align: center;
    background: rgba(230, 247, 255, 0.6);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #a4d3ee;
    box-shadow: 0 5px 15px rgba(10, 61, 98, 0.1);
}

.home-actions {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 40px;
}

.btn-primary {
    background: linear-gradient(135deg, #0652DD 0%, #22a6b3 100%);
    color: white;
    padding: 18px 45px;
    border-radius: 50px;
    font-size: 20px;
    font-weight: 700;
    min-width: 250px;
    box-shadow: 0 10px 25px rgba(6, 82, 221, 0.3);
    transition: all 0.4s;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-7px);
    box-shadow: 0 15px 30px rgba(6, 82, 221, 0.4);
}

.btn-primary::after {
    content: "→";
    margin-left: 15px;
    font-size: 24px;
    transition: transform 0.3s;
}

.btn-primary:hover::after {
    transform: translateX(8px);
}

.btn-accent {
    background: linear-gradient(135deg, #0a3d62 0%, #1a5f87 100%);
    color: white;
    padding: 18px 45px;
    border-radius: 50px;
    font-size: 20px;
    font-weight: 700;
    min-width: 250px;
    box-shadow: 0 10px 25px rgba(10, 61, 98, 0.3);
    transition: all 0.4s;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.btn-accent:hover {
    transform: translateY(-7px);
    box-shadow: 0 15px 30px rgba(10, 61, 98, 0.4);
}

.home-features {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 60px 0 40px;
    flex-wrap: wrap;
}

.feature-card {
    background: rgba(230, 247, 255, 0.8);
    border-radius: 20px;
    padding: 35px 30px;
    width: 280px;
    box-shadow: 0 10px 30px rgba(10, 61, 98, 0.15);
    transition: all 0.4s;
    border: 2px solid rgba(23, 107, 135, 0.2);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.feature-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 15px 35px rgba(34, 166, 179, 0.3);
    border-color: #22a6b3;
}

.feature-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #0652DD, #22a6b3);
}

.feature-icon {
    font-size: 60px;
    margin-bottom: 25px;
    color: #0a3d62;
    text-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
}

.feature-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #0a3d62;
}

.feature-description {
    color: #1a5f87;
    font-size: 17px;
    line-height: 1.7;
}

.home-footer {
    margin-top: 60px;
    color: #1a5f87;
    font-size: 18px;
    border-top: 2px solid #a4d3ee;
    padding-top: 30px;
}

.school-logo {
    font-size: 28px;
    font-weight: 800;
    color: #0a3d62;
    margin-bottom: 15px;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

/* ====================== 响应式设计 ====================== */
@media (max-width: 768px) {
    .container, .home-container {
        padding: 35px 25px;
        margin: 30px 15px;
    }
    
    .home-container h1 {
        font-size: 34px;
    }
    
    .home-description {
        font-size: 18px;
        padding: 20px;
    }
    
    .home-actions, .action-buttons {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }
    
    .btn, .vote-btn, .admin-link, .action-btn, .btn-primary, .btn-accent {
        width: 100%;
        max-width: 350px;
        text-align: center;
        padding: 16px 30px;
        font-size: 18px;
    }
    
    .feature-card {
        width: 100%;
        max-width: 350px;
    }
    
    .poll-item, .result-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .vote-tag, .vote-count {
        margin-top: 15px;
        align-self: flex-start;
    }
    
    h1 {
        font-size: 26px;
    }
    
    .home-container h1 {
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container, .home-container {
        padding: 25px 20px;
        border-radius: 15px;
    }
    
    h1, .home-container h1 {
        font-size: 24px;
        padding-bottom: 12px;
    }
    
    .btn, .vote-btn, .admin-link, .action-btn, .btn-primary, .btn-accent {
        padding: 14px 25px;
        font-size: 17px;
        min-width: auto;
    }
    
    .feature-card {
        padding: 25px 20px;
    }
    
    .feature-icon {
        font-size: 50px;
    }
    
    .feature-title {
        font-size: 22px;
    }
    
    .home-container h1 {
        font-size: 28px;
    }
    
    .home-description {
        font-size: 16px;
        padding: 18px;
    }
    
    .school-logo {
        font-size: 24px;
    }
}

/* 气泡动画效果 */
@keyframes bubble {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100px) scale(1.2);
        opacity: 0;
    }
}

.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: bubble 8s infinite;
    z-index: -1;
}

/* 创建气泡 */
body::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    animation: bubble 15s infinite;
    z-index: -1;
}

/* 添加多个气泡 */
body::after {
    left: 10%;
    top: 80%;
    width: 15px;
    height: 15px;
    animation-delay: 0s;
}

body::before {
    content: "";
    position: absolute;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    animation: bubble 12s infinite;
    z-index: -1;
    left: 30%;
    top: 70%;
    animation-delay: 2s;
}

/* 添加更多气泡 */
.bubble:nth-child(1) {
    left: 20%;
    top: 90%;
    width: 18px;
    height: 18px;
    animation-delay: 1s;
    animation-duration: 10s;
}

.bubble:nth-child(2) {
    left: 50%;
    top: 85%;
    width: 22px;
    height: 22px;
    animation-delay: 3s;
    animation-duration: 14s;
}

.bubble:nth-child(3) {
    left: 70%;
    top: 75%;
    width: 12px;
    height: 12px;
    animation-delay: 2s;
    animation-duration: 8s;
}

/* 海星装饰 */
.starfish {
    position: absolute;
    font-size: 24px;
    color: #e74c3c;
    opacity: 0.7;
    z-index: -1;
    animation: float 15s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
    100% {
        transform: translateY(0) rotate(360deg);
    }
}

/* 添加海星 */
.starfish:nth-child(1) {
    top: 10%;
    left: 5%;
    animation-duration: 20s;
}

.starfish:nth-child(2) {
    top: 30%;
    right: 10%;
    animation-duration: 25s;
    animation-delay: 5s;
}

.starfish:nth-child(3) {
    bottom: 20%;
    left: 15%;
    animation-duration: 18s;
    animation-delay: 3s;
}

/* 水波纹效果 */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(34, 166, 179, 0.2);
    transform: scale(0);
    animation: ripple 3s infinite;
    z-index: -1;
}

@keyframes ripple {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

/* 添加水波纹 */
.ripple:nth-child(1) {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 20%;
}

.ripple:nth-child(2) {
    width: 150px;
    height: 150px;
    bottom: 30%;
    right: 15%;
    animation-delay: 1s;
}

.ripple:nth-child(3) {
    width: 80px;
    height: 80px;
    top: 40%;
    right: 25%;
    animation-delay: 2s;
}